06. String Manipulation Quiz 1

In Intro to Computer Science, Dave Evans challenges you to use Python to convert "audacity" to "Udacity". Let's see if you can perform the same manipulation with JavaScript.

Your Challenge

Using string methods, convert "audacity" to "Udacity".

Check out MDN's documentation on JavaScript string methods before you get started (hint: slice() will probably be useful).

Start Quiz:

/*
 * Programming Quiz: String Manipulation Quiz 1
 *
 * Using string methods, convert "audacity" to "Udacity"
 */

var text = "audacity";

var udacityizer = function(string) {
  // Right now, the variable string === "audacity"
  // Manipulate string to make it equal to "Udacity"
  // Your code goes here!

  return string;
};

// Did your code work? The line below will tell you!
console.log(udacityizer(text));

Your code is going inside a function, which is a set of instructions that are bundled together. You'll be learning more about functions in the next lesson. Don't worry though, all you need to do is write your code where it says "Your code goes here!" and you'll be fine :)

Follow your instructors!

@cwpittman

+jameswilliams